package com.example.newspublish.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.newspublish.annotation.AutoFill;
import com.example.newspublish.pojo.dto.NewsPageDTO;
import com.example.newspublish.pojo.entity.News;
import com.example.newspublish.pojo.vo.NewsPageVO;
import com.example.newspublish.util.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface NewsMapper extends BaseMapper<News> {

    List<News> getNewsListById(Long categoryId);

    List<News> getNewsList();

    News getNewDetailById(Long id);

    @AutoFill(value = OperationType.INSERT)
    int addNew(News newsItem);

    int deleteNewById(Long id);

    List<News> search(String key);

//    Page<NewsPageVO> pageQuery(NewsPageDTO newsPageDTO);
}
